<?php

/**
 * Created by PhpStorm.
 * User: shwy
 * Date: 2017/8/14
 * Time: 16:59
 * Curl辅助类
 */
require_once './application/third_party/curl/Requests.php';


class Curl extends Requests{
    public function __construct()
    {
        self::register_autoloader();
    }

    /**
     * curl post 请求方法
     * @param $url
     * @param $data
     * @return Requests_Response
     * 返回的是json字符串
     */
    public function curlGet($url,$data){

        return Requests::get($url, array('Accept' => 'application/json'),$data);

    }

    /**
     * curl post 请求方法
     * @param $url
     * @param $data
     * @return Requests_Response
     * 返回的是json字符串
     */
    public function curlPost($url,$data){

        return Requests::post($url, array('Accept' => 'application/json'),$data);

    }
}









































